yyyymmdd to yyyy-mm-dd php

117

$var = '20/04/2012';
$date = str_replace('/', '-', $var);
echo date('Y-m-d', strtotime($date));

Comments

Submit
0 Comments